Skip to content

uv: continue Python installation after bootstrapping uv - #1872

Merged
Eleanor Boyd (eleanorjboyd) merged 3 commits into
microsoft:mainfrom
eleanorjboyd:agents/fix-uv-bootstrap-path
Oct 6, 2026
Merged

Eleanor Boyd (eleanorjboyd) merged 3 commits into
microsoft:mainfrom
eleanorjboyd:agents/fix-uv-bootstrap-path

Conversation

@eleanorjboyd

@eleanorjboyd Eleanor Boyd (eleanorjboyd) commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #1871.

This prevents a broken first-run experience without introducing lasting configuration or PATH side effects.

Problem

When uv's install directory is not already on the extension host's PATH, the official installer can succeed but the subsequent bare uv --version lookup still fails. Python installation then stops at uvNotOnPath.

Updating shell startup files does not update the already-running extension host's environment. Resetting the availability cache alone cannot fix this.

Changes

  • Retain the installed uv executable for the current extension-host session, honoring the standalone installer's explicit, legacy, unmanaged, XDG, and default destinations.
  • Use that executable consistently for availability checks, Python installation, installed/available Python version listing, and subsequent shared uv operations.
  • Preserve the executable across availability-cache resets and prevent an older in-flight check from overwriting a newly reset cache.
  • Leave process PATH and the integrated terminal's PATH unchanged.
  • Add 23 regression cases covering the complete bootstrap handoff, failures, inline-script version lookup, cache behavior, and Windows/POSIX destination naming. Update the uv behavior documentation.

Keep the standalone installer's uv path for verification, Python installation and listing, and subsequent uv operations without changing the extension host PATH. Add bootstrap, destination, and cache regression coverage for microsoft#1871.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eleanorjboyd Eleanor Boyd (eleanorjboyd) added the bug Issue identified by VS Code Team member as probable bug label Oct 6, 2026
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) merged commit ab8e95f into microsoft:main Oct 6, 2026
56 checks passed
Eleanor Boyd (eleanorjboyd) added a commit that referenced this pull request Oct 12, 2026
Fixes #1832.

Depends on #1872, which retains a newly installed uv executable for the
current extension-host session.

## Problem

Creating a **Global** environment on a machine without uv failed with
**Failed to fetch available Python versions**. The flow attempted `uv
python list` before reaching the existing uv installation path.

## User experience

When uv is missing, Global environment creation now explains why it is
required and offers:

- **Install uv** — installs uv, then continues directly to the Python
version picker using #1872's retained executable.
- **Other installation options** — opens the official [Install a Python
interpreter](https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter)
guide.
- **Cancel** — cancels quietly without showing a misleading
version-fetch error.

If uv installation fails, the error offers **View Logs**. When uv is
already available, the version picker opens without an additional
prompt.

This prevents a broken first-run experience without introducing lasting
configuration or PATH side effects.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python installation stops after successful uv bootstrap

2 participants